QT       += core gui webenginewidgets webchannel
QT       += charts concurrent multimedia multimediawidgets

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++17
RC_ICONS = applogo.ico
TARGET = LrDeviceMonitor
QMAKE_TARGET_COMPANY = "Lightrim Automation Inc."
QMAKE_TARGET_DESCRIPTION = "Lightrim Cloud Platform"
QMAKE_TARGET_COPYRIGHT = "Copyright(C) 2024~2025"
QMAKE_TARGET_PRODUCT = "上海廉容小水电云集控平台"
VERSION = 2.3.0

msvc {
    QMAKE_CFLAGS += /utf-8
    QMAKE_CXXFLAGS += /utf-8
}

DEFINES += HAVE_CONFIG_H
DEFINES += APP_VERSION=\\\"$$VERSION\\\"

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000
# disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
    CLineEdit.cpp \
    MonitorWork.cpp \
    QtMqtt.cpp \
    ai/AIAccount.cpp \
    ai/AISetup.cpp \
    ai/ApiSigner.cpp \
    ai/ApiTencent.cpp \
    ai/ApiWorker.cpp \
    ai/FaultDiagnosis.cpp \
    ai/RainReport.cpp \
    ai/RainView.cpp \
    devop/DevNews.cpp \
    devop/DeviceInfo.cpp \
    devop/PassWd.cpp \
    devop/ProductionReport.cpp \
    devop/V10Main.cpp \
    devop/V10ParaSetting.cpp \
    devop/V10RealData.cpp \
    devop/V15BaseSetting.cpp \
    devop/V15Channel.cpp \
    devop/V15Main.cpp \
    devop/V15PortSetting.cpp \
    devop/V15RealData.cpp \
    devop/V15RunPara.cpp \
    devop/V15UnitPara.cpp \
    devop/V20JDatacom.cpp \
    devop/V20JLinuxOS.cpp \
    devop/V20JNetwork.cpp \
    devop/V20JUsrInfo.cpp \
    devop/V20Main.cpp \
    devop/V20ParaSetting.cpp \
    devop/V20RealData.cpp \
    devop/V20YDeviceEnable.cpp \
    devop/V20YPMPower.cpp \
    devop/V20YRunModeSecure.cpp \
    devop/V20YShutdown.cpp \
    devop/V20YStartupOngrid.cpp \
    devop/V20YSwitching.cpp \
    devop/V20YTemperature.cpp \
    devop/V20YUnitParameter.cpp \
    devop/V20YWaterLevel.cpp \
    devop/WkThreadMain.cpp \
    dialog.cpp \
    global.cpp \
    main.cpp \
    monitor.cpp \
    navigation.cpp \
    ai/AIEnabling.cpp \
    pages/AreaPicker.cpp \
    pages/Blacklist.cpp \
    pages/CameraMonitor.cpp \
    pages/DatePicker.cpp \
    pages/DevCarousel.cpp \
    pages/DevCarouselWork.cpp \
    pages/DevFaultAlarm.cpp \
    pages/DevFaultList.cpp \
    pages/DeviceListWorker.cpp \
    pages/DeviceNews.cpp \
    pages/DeviceState.cpp \
    pages/DeviceStatiSetup.cpp \
    pages/DeviceStatistics.cpp \
    pages/DeviceStatisticsWork.cpp \
    pages/DevicesList.cpp \
    pages/FDLiangStat.cpp \
    pages/FormMap.cpp \
    pages/FormMapSetup.cpp \
    pages/FormMapShow.cpp \
    pages/FormMapWork.cpp \
    pages/HikVideoWorker.cpp \
    pages/TianqiYubao.cpp \
    pages/SearchDevice.cpp \
    pages/TianqiYubaoSetup.cpp \
    pages/TopStatistics.cpp \
    pages/streammanager.cpp \
    pages/usrBind.cpp \
    pages/usrFindpwd.cpp \
    pages/usrRegister.cpp \
    pages/usrSettings.cpp \
    pages/usrinfo.cpp \
    qrcode/bitstream.c \
    qrcode/mask.c \
    qrcode/mmask.c \
    qrcode/mqrspec.c \
    qrcode/qrencode.c \
    qrcode/qrinput.c \
    qrcode/qrspec.c \
    qrcode/rsecc.c \
    qrcode/split.c \
    rulerbar.cpp \
    usrlogin.cpp

HEADERS += \
    CLineEdit.h \
    MonitorWork.h \
    QtMqtt.h \
    ai/AIAccount.h \
    ai/AISetup.h \
    ai/ApiSigner.h \
    ai/ApiTencent.h \
    ai/ApiWorker.h \
    ai/FaultDiagnosis.h \
    ai/RainReport.h \
    ai/RainView.h \
    devop/DevNews.h \
    devop/DeviceInfo.h \
    devop/PassWd.h \
    devop/ProductionReport.h \
    devop/V10Main.h \
    devop/V10ParaSetting.h \
    devop/V10RealData.h \
    devop/V15BaseSetting.h \
    devop/V15Channel.h \
    devop/V15Main.h \
    devop/V15PortSetting.h \
    devop/V15RealData.h \
    devop/V15RunPara.h \
    devop/V15UnitPara.h \
    devop/V20JDatacom.h \
    devop/V20JLinuxOS.h \
    devop/V20JNetwork.h \
    devop/V20JUsrInfo.h \
    devop/V20Main.h \
    devop/V20ParaSetting.h \
    devop/V20RealData.h \
    devop/V20YDeviceEnable.h \
    devop/V20YPMPower.h \
    devop/V20YRunModeSecure.h \
    devop/V20YShutdown.h \
    devop/V20YStartupOngrid.h \
    devop/V20YSwitching.h \
    devop/V20YTemperature.h \
    devop/V20YUnitParameter.h \
    devop/V20YWaterLevel.h \
    devop/WkThreadMain.h \
    dialog.h \
    global.h \
    monitor.h \
    navigation.h \
    ai/AIEnabling.h \
    pages/AreaPicker.h \
    pages/Blacklist.h \
    pages/CameraMonitor.h \
    pages/DatePicker.h \
    pages/DevCarousel.h \
    pages/DevCarouselWork.h \
    pages/DevFaultAlarm.h \
    pages/DevFaultList.h \
    pages/DeviceListWorker.h \
    pages/DeviceNews.h \
    pages/DeviceState.h \
    pages/DeviceStatiSetup.h \
    pages/DeviceStatistics.h \
    pages/DeviceStatisticsWork.h \
    pages/DevicesList.h \
    pages/FDLiangStat.h \
    pages/FormMap.h \
    pages/FormMapSetup.h \
    pages/FormMapShow.h \
    pages/FormMapWork.h \
    pages/HikVideoWorker.h \
    pages/TianqiYubao.h \
    pages/SearchDevice.h \
    pages/TianqiYubaoSetup.h \
    pages/TopStatistics.h \
    pages/streammanager.h \
    pages/usrBind.h \
    pages/usrFindpwd.h \
    pages/usrRegister.h \
    pages/usrSettings.h \
    pages/usrinfo.h \
    qrcode/bitstream.h \
    qrcode/config.h \
    qrcode/mask.h \
    qrcode/mmask.h \
    qrcode/mqrspec.h \
    qrcode/qrencode.h \
    qrcode/qrencode_inner.h \
    qrcode/qrinput.h \
    qrcode/qrspec.h \
    qrcode/rsecc.h \
    qrcode/split.h \
    rulerbar.h \
    usrlogin.h

FORMS += \
    ai/AIAccount.ui \
    ai/AISetup.ui \
    ai/FaultDiagnosis.ui \
    ai/RainReport.ui \
    ai/RainView.ui \
    devop/DevNews.ui \
    devop/DeviceInfo.ui \
    devop/PassWd.ui \
    devop/ProductionReport.ui \
    devop/V10Main.ui \
    devop/V10ParaSetting.ui \
    devop/V10RealData.ui \
    devop/V15BaseSetting.ui \
    devop/V15Channel.ui \
    devop/V15Main.ui \
    devop/V15PortSetting.ui \
    devop/V15RealData.ui \
    devop/V15RunPara.ui \
    devop/V15UnitPara.ui \
    devop/V20JDatacom.ui \
    devop/V20JLinuxOS.ui \
    devop/V20JNetwork.ui \
    devop/V20JUsrInfo.ui \
    devop/V20Main.ui \
    devop/V20ParaSetting.ui \
    devop/V20RealData.ui \
    devop/V20YDeviceEnable.ui \
    devop/V20YPMPower.ui \
    devop/V20YRunModeSecure.ui \
    devop/V20YShutdown.ui \
    devop/V20YStartupOngrid.ui \
    devop/V20YSwitching.ui \
    devop/V20YTemperature.ui \
    devop/V20YUnitParameter.ui \
    devop/V20YWaterLevel.ui \
    dialog.ui \
    monitor.ui \
    navigation.ui \
    ai/AIEnabling.ui \
    pages/AreaPicker.ui \
    pages/Blacklist.ui \
    pages/CameraMonitor.ui \
    pages/DatePicker.ui \
    pages/DevCarousel.ui \
    pages/DevFaultAlarm.ui \
    pages/DevFaultList.ui \
    pages/DeviceNews.ui \
    pages/DeviceStatiSetup.ui \
    pages/DeviceStatistics.ui \
    pages/DevicesList.ui \
    pages/FDLiangStat.ui \
    pages/FormMap.ui \
    pages/FormMapSetup.ui \
    pages/FormMapShow.ui \
    pages/TianqiYubao.ui \
    pages/SearchDevice.ui \
    pages/TianqiYubaoSetup.ui \
    pages/TopStatistics.ui \
    pages/usrBind.ui \
    pages/usrFindpwd.ui \
    pages/usrRegister.ui \
    pages/usrSettings.ui \
    pages/usrinfo.ui \
    usrlogin.ui


# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

DISTFILES += \
    monitor.pri \
    qrcode/libqrcode.a

RESOURCES += \
    Resources.qrc


# Redis库
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/hiredis/lib/ -lhiredis
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/hiredis/lib/ -lhiredisd

INCLUDEPATH += $$PWD/hiredis/include
DEPENDPATH += $$PWD/hiredis/include

INCLUDEPATH += $$PWD/HivVision/include
DEPENDPATH += $$PWD/HivVision/include

INCLUDEPATH += $$PWD/VLC-Qt/include
DEPENDPATH += $$PWD/VLC-Qt/include

INCLUDEPATH += $$PWD/QtMqtt/msvc/include
DEPENDPATH += $$PWD/QtMqtt/msvc/include

# MQTT
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/QtMqtt/msvc/lib/ -lQt5Qmqtt
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/QtMqtt/msvc/lib/ -lQt5Qmqttd

# VideoSDK
win32 {
    LIBS += -L$$PWD/HivVision/lib -lVideoSDK
    QMAKE_POST_LINK += copy /Y $$PWD\\HivVision\\bin\\*.dll $$OUT_PWD

    LIBS += -L$$PWD/VLC-Qt/lib -lVLCQtCore -lVLCQtWidgets
    QMAKE_POST_LINK += copy /Y $$PWD\\VLC-Qt\\bin\\*.dll $$OUT_PWD

    # OpenSSL 和网络依赖
    LIBS += -lws2_32 -lcrypt32
}
# tencentcloud-sdk
INCLUDEPATH += $$PWD/tencentcloud-sdk-cpp/core/include
INCLUDEPATH += $$PWD/tencentcloud-sdk-cpp/lkeap/include
CONFIG(debug, debug|release) {
    LIBS += -L$$PWD/tencentcloud-sdk-cpp/lib/Debug -ltencentcloud-sdk-cpp-core
    QMAKE_POST_LINK += copy /Y $$PWD\\tencentcloud-sdk-cpp\\bin\\Debug\\*.dll $$OUT_PWD
} else {
    LIBS += -L$$PWD/tencentcloud-sdk-cpp/lib/Release -ltencentcloud-sdk-cpp-core
    QMAKE_POST_LINK += copy /Y $$PWD\\tencentcloud-sdk-cpp\\bin\\Release\\*.dll $$OUT_PWD
}

# 禁用RTTI和异常
CONFIG += no_rtti no_exceptions
